/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gr.context;

import com.gr.analys.VietAnalyzer;
import com.maxmind.geoip.Location;
import com.maxmind.geoip.LookupService;

/**
 *
 * @author Hieudt
 */
public class ContextManager {
    private Profile profile;
    private QueryLog queryLog;
    private Location location;
    private VietAnalyzer viA = new VietAnalyzer();
    public ContextManager(){
    queryLog = null;
    profile =null;     
}
    public ContextManager(int id, String ip) throws Exception{
    queryLog = null;
    profile = new Profile(id);
    LookupService cl = new LookupService("C:/GeoIP/GeoLiteCity.dat",
					LookupService.GEOIP_MEMORY_CACHE );
    location = cl.getLocation(ip); 
       
}
    public Profile getProfile(){
        System.out.println("ContextManager: "+this.profile.toString());
        return this.profile;
    }
    public QueryLog getQueryLog(){
        return this.queryLog;
    }
    public Location getLocation(){
        return this.location;
    }       
    public void setProfile(Profile p){
        this.profile =p;
    }
    public void setLocation(Location l){
        this.location =l;
    }
    public void setLogList(QueryLog ql){
    this.queryLog =ql;
    }  
}

